<include file="Public:header" />
<style>
	.table >tbody >tr >td{line-height:1.42857;}
	.ibox-title{
		border:none;
	}
	.ibox-title-small{
		border-top: 1px solid #e7eaec;
	    background: #ffffff;
	   	padding: 5px 15px 0px 15px;
	}
	.ibox-title-small{
	    background: #ffffff;
	   	padding: 5px 15px 0px 15px;
	}
	.filelist{
	    border: 1px dashed #d8e3ef;
	    width: 97.2%;
	    margin-left: 8px;
	    margin-bottom: 65px;
	}
	.filelist .tsinfo{
	   	margin-top: 10px;
	    margin-bottom: 10px;
	    display: block;
	    margin-left: 10px;
	}
	.filelist .fujian{
		margin-left: 8px;
    	color: #646464;
	}
	#reparynow{
		border-top: 1px solid #d8e3ef;
    	padding: 10px;
	}
	#content_lanage
	{
		border: 1px solid #eee;
	    min-height: 51px;
	    padding: 10px;
	    border-radius: 2px;
	}
	#content_lanage:empty::before{  
        color:#cab0ba;
        content:attr(placeholder);  
    }
    #but_sub{
    	margin-top: 10px;
	    float: right;
	    margin-bottom: 10px;
    }
    .talkcontent{
    	clear: both;
    	padding:10px;
    }
    .talkcontent .talknow{
    	padding:10px;
    }
    .imgtx{
    	width: 28px;
    	float: left;
    }
    .neirong{
    	margin-left: 42px;
    	word-wrap: break-word;
    	border-bottom:1px solid #eee;
    }
    .reply_talk{
    	margin: 12px 0 12px 0;
    }
    .reply_content{
	    border: 1px solid #aaa;
	    min-height: 80px;
	    padding: 10px;
	    border-radius: 2px;
	    margin-left: 43px;
    }
    .reply_content:empty::before{  
        color:#cab0ba;
        content:attr(placeholder);  
    }  
    .btn_reply{
    	margin-top: 0px;
    	float: right;
    }
</style>
<!--the css for jquery.mCustomScrollbar-->
<link rel="stylesheet" href="__PUBLIC__/emoji/css/jquery.mCustomScrollbar.min.css"/>
<!--the css for this plugin-->
<link rel="stylesheet" href="__PUBLIC__/emoji/css/jquery.emoji.css"/>
<div class="wrapper wrapper-content " >
	<include file="Public:alert" />
    <div class="row">
        <div class="col-sm-12">
			<div class="title-bar" style="">
				<div class="row " id="title-show">
					<ul class="nav pull-left" style="margin:0px 10px 0px 20px;">
						<span><img src="__PUBLIC__/img/log_view_icon.png" style="margin-bottom:9px;" alt=""></span><span style="font-size:21px;margin-left:5px">&nbsp;&nbsp;&nbsp;{$log['subject']}</span>&nbsp;&nbsp; 
					</ul>
					<a href="{:U('log/mylog_edit','id='.$log['log_id'])}" class="btn btn-outline btn-default pull-right" style="margin-right: 15px;"><i class="fa fa-pencil"></i>&nbsp;&nbsp;编辑</a>&nbsp;&nbsp;
				</div>
			</div>
			<div class="col-sm-7 ibox-content" style="background-color:#fff;">
				<div class="ibox-title clearfix" style="">
					<div class="pull-left">
						<em style="color:#999;font-size:15px;">{$log['creator']['full_name']} 的工作总结</em>
					</div>
					<div class="pull-right">
						<span>{$log['category_name']}</span>
					</div>
				</div>
				<table class="table form-inline" border="0" cellspacing="1" cellpadding="0">
					<input type="hidden" id="log_id" value="{$log['log_id']}" />
					<input type="hidden" id="send_role_id" value="{:session('role_id')}" />
					<tbody >
						<tr >
							<td colspan="2">
								<div class="log_content" style="background-color:#fff;word-break: break-word;line-height: 21px;padding: 20px;">{$log['content']}</div>
							</td>							
						</tr>
					</tbody>
				</table>
				<div class="filelist">
					<span class="tsinfo"><img src="__PUBLIC__/img/addFile.png"/><span class="fujian">附件&nbsp;({$log['file_count']})</span></span>
					<volist name="log['file']" id="vo">
						<div class="file_tr" style="padding: 6px;">
							<img src="__PUBLIC__/productImg/{$vo['pic']}">&nbsp;<if condition="in_array(getExtension($vo['name']),imgFormat())"><a class="litebox_file" href="{$vo['file_path']}" title="点击查看大图" data-litebox-group="group-{$log['log_id']}">{$vo.name}</a><elseif condition = "in_array($vo['format'],array('txt','pdf'))" /><a href="javascript:void(0);" class="file_view" rel="{$vo['file_path']}" title="{$vo.name}">{$vo.name}</a><else /><a href="{$vo['file_path']}" >{$vo.name}</a></if><span style="color:#646464;">&nbsp;(&nbsp;{$vo['size']}KB&nbsp;)</span>&nbsp;&nbsp;<a class="controls_file" style="float: right;display: none;margin-right: 20px;" href="javascript:;" file="{$vo.file_path}" filename="{$vo.name}" onclick="filedown(this);">下载</a></div>
					</volist>
				</div>
				<div id="reparynow">
					<div id="content_lanage" contenteditable="true" placeholder="添加回复..."></div>
					<div style="margin-top: 5px;">
						<input type="image" id="btn_emoji" src="__PUBLIC__/img/emoji.png" />
					</div>
					<div id="but_sub" style="display: none;"><button class="btn btn-primary subit" disabled="true" id="add_language" type="button">发 表</button></div>
				</div>
				<div class="talkcontent" id="talkcontent_{$log['log_id']}">
					<div class="spiner-example">
					    <div class="sk-spinner sk-spinner-three-bounce">
					        <div class="sk-bounce1"></div>
					        <div class="sk-bounce2"></div>
					        <div class="sk-bounce3"></div>
					    </div>
					</div>
				</div>
			</div>
			<div class="col-sm-5" style="padding-right:0px;" >
				<div class="ibox-content">
					<div class="ibox-title" style="border-top: 3px solid #e7eaec;">
						<div class="pull-left">
							<span style="font-size:14px;">当日工作汇总</span>
						</div>
					</div>
					<div class="ibox-title-small" >
						<div>
							<span style="line-height:35px;">销售简报</span>
						</div>
					</div>
					<div class=" container-fluid ">
						<div class="col-sm-12">
							<div class="col-sm-3">
								<span>新增客户</span>
								<div style="margin-top:10px;"><span style="font-size:20px;">{$anly_count['customer_count']}</span>个</div>
							</div>
							<div class="col-sm-3">
								<span>新增联系人</span>
								<div style="margin-top:10px;"><span style="font-size:20px;">{$anly_count['contacts_count']}</span>个</div>
							</div>
							<div class="col-sm-3">
								<span>新增商机</span>
								<div style="margin-top:10px;"><span style="font-size:20px;">{$anly_count['business_count']}</span>个</div>
							</div>
							<div class="col-sm-3">
								<span>沟通日志</span>
								<div style="margin-top:10px;"><span style="font-size:20px;">{$anly_count['log_count']}</span>个</div>
							</div>
							<div style="clear:both;"></div>
						</div>
					</div>
					<div class="ibox-title-small" >
						<div>
							<span style="line-height:35px;">交易</span>
						</div>
					</div>
					<div class=" container-fluid ">
						<div class="col-sm-12" style="margin-bottom: 20px;">
							<div class="col-sm-4">
								<span>签订合同</span>
								<div style="margin-top:10px;color:#1985DC;"><span style="font-size:20px;">{$anly_count['contract_count']}</span>个</div>
							</div>
							<div class="col-sm-4">
								<span>回款总金额</span>
								<div style="margin-top:10px;"><span style="font-size:20px;">{$anly_count['receivingorder_sum']}</span>万元</div>
							</div>
							<div style="clear:both;"></div>
						</div>
					</div>
				</div>
			</div>
			<div style="clear:both;"></div>
        </div>
    </div>
</div>
<link href="__PUBLIC__/css/litebox.css" rel="stylesheet" type="text/css">
<script src="__PUBLIC__/js/litebox.min.js" type="text/javascript"></script>
<script src="__PUBLIC__/js/images-loaded.min.js" type="text/javascript"></script>
<!--(Optional) the js for jquery.mCustomScrollbar's addon-->
<script src="__PUBLIC__/emoji/js/jquery.mousewheel-3.0.6.min.js"></script>
<!--the js for jquery.mCustomScrollbar-->
<script src="__PUBLIC__/emoji/js/jquery.mCustomScrollbar.min.js"></script>
<!--the js for this plugin-->
<script src="__PUBLIC__/emoji/js/jquery.emoji.js"></script>
<script type="text/javascript">
$(".file_tr").mouseenter(function(){
	$(this).find(".controls_file").show();
}).mouseleave(function(){
	$(this).find(".controls_file").hide();
});
 //处理日志换行显示
var element = $("div[class='log_content']");
var temp =  element.text().replace(/\n/g,'<br/>');
element.html(temp);

$("#content_lanage").emoji({
	button:"#btn_emoji",
    showTab: true,
    animation: 'slide',
    icons: [{
    	name: "小表情",
        path: "__PUBLIC__/emoji/img/tieba/",
        maxNum: 50,
        file: ".jpg",
        placeholder: ":{alias}:",
        alias: {
            1: "hehe",
            2: "haha",
            3: "tushe",
            4: "a",
            5: "ku",
            6: "lu",
            7: "kaixin",
            8: "han",
            9: "lei",
            10: "heixian",
            11: "bishi",
            12: "bugaoxing",
            13: "zhenbang",
            14: "qian",
            15: "yiwen",
            16: "yinxian",
            17: "tu",
            18: "yi",
            19: "weiqu",
            20: "huaxin",
            21: "hu",
            22: "xiaonian",
            23: "neng",
            24: "taikaixin",
            25: "huaji",
            26: "mianqiang",
            27: "kuanghan",
            28: "guai",
            29: "shuijiao",
            30: "jinku",
            31: "shengqi",
            32: "jinya",
            33: "pen",
            34: "aixin",
            35: "xinsui",
            36: "meigui",
            37: "liwu",
            38: "caihong",
            39: "xxyl",
            40: "taiyang",
            41: "qianbi",
            42: "dnegpao",
            43: "chabei",
            44: "dangao",
            45: "yinyue",
            46: "haha2",
            47: "shenli",
            48: "damuzhi",
            49: "ruo",
            50: "OK"
        },
        title: {
            1: "呵呵",
            2: "哈哈",
            3: "吐舌",
            4: "啊",
            5: "酷",
            6: "怒",
            7: "开心",
            8: "汗",
            9: "泪",
            10: "黑线",
            11: "鄙视",
            12: "不高兴",
            13: "真棒",
            14: "钱",
            15: "疑问",
            16: "阴脸",
            17: "吐",
            18: "咦",
            19: "委屈",
            20: "花心",
            21: "呼~",
            22: "笑脸",
            23: "冷",
            24: "太开心",
            25: "滑稽",
            26: "勉强",
            27: "狂汗",
            28: "乖",
            29: "睡觉",
            30: "惊哭",
            31: "生气",
            32: "惊讶",
            33: "喷",
            34: "爱心",
            35: "心碎",
            36: "玫瑰",
            37: "礼物",
            38: "彩虹",
            39: "星星月亮",
            40: "太阳",
            41: "钱币",
            42: "灯泡",
            43: "茶杯",
            44: "蛋糕",
            45: "音乐",
            46: "haha",
            47: "胜利",
            48: "大拇指",
            49: "弱",
            50: "OK"
        }
    },
       { name: "萌萌哒",
        path: "__PUBLIC__/emoji/img/qq/",
        maxNum: 91,
        excludeNums: [41, 45, 54],
        file: ".gif"
    }]
});
</script>
<script>
//最后一个样式
 $(".neirong:last").css('border','none');
 var log_id = $('#log_id').val();
 var send_role_id = $('#send_role_id').val();
 $(function(){
 	var url = "{:U('log/commentShow')}";
 	$('.talkcontent').load(url,{log_id:log_id});
 });
/**
 * 附件 如果是图片时 双击可查看大图
 */
$('.litebox_file').liteBox({
  revealSpeed: 400,
  background: 'rgba(0,0,0,.8)',
  overlayClose: true,
  escKey: true,
  navKey: true,
  errorMessage: '图片加载失败.'
});
//div 回复 添加
$('#content_lanage').focus(function(){
	$(".subit").removeAttr('disabled');
	$("#but_sub").fadeIn("3000");
});
$('#content_lanage').focusout(function(){
	var content = $(this).html();
	if(!content){
		$("#but_sub").fadeOut("3000");
		$(".subit").prop('disabled',true);
		$(this).html('');
	}
});
//点击发表后
function add_after(){
	$('#content_lanage').html('');
	$('#content_lanage').attr('placeholder');
	$("#but_sub").fadeOut("3000");
	$(".subit").prop('disabled',true);
}
/*
*添加首次回复调用
 */
$('#add_language').click(function(){
	var content_lanage = $('#content_lanage').html();
	$.post("{:U('log/myCommont')}",{content:content_lanage,log_id:log_id,send_role_id:send_role_id},function(data){
			if(data.status == 1){
				add_after();//还原初始状态
				var url = "{:U('log/commentShow')}";
 				$('.talkcontent').load(url,{log_id:log_id});	
			}else{
				alert_crm(data.info);
			}
		},"json"
	);
});
</script>
<include file="Public:footer" />